import type { App } from 'vue';
import { createRouter, createWebHashHistory } from 'vue-router';

export const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      component: () => import('../views/home/index.vue'),
    },
    {
      name: 'not-found',
      path: '/:pathMatch(.*)*',
      component: () => import('../views/common/404.vue'),
      meta: {
        title: '404 Not Found',
      }
    }
  ],
});

export async function setupRouter(app: App) {
  app.use(router);
  await router.isReady();
}
